//
//  EFengShareNewCommentFrame.m
//  WZEfengAndEtong
//
//  Created by wanzhao on 16/3/15.
//  Copyright © 2016年 wanzhao. All rights reserved.
//

#import "EFengShareNewCommentFrame.h"
#import "EFengContent.h"

@implementation EFengShareNewCommentFrame


- (void)setUnReadComment:(EFengContent *)unReadComment
{
    _unReadComment = unReadComment;
    _headFrame = CGRectMake(10.0f, 10.0f, 50.0f, 50.0f);
    _nameFrame = CGRectMake(CGRectGetMaxX(_headFrame) + 10.0f, 10.0f, 100.0f, Font14.lineHeight);
    CGSize contentSize = [unReadComment.content sizeWithFont:Font13 maxSize:CGSizeMake(HARDWARE_SCREEN_WIDTH - 85.0f - CGRectGetMaxX(_headFrame) - 10.0f, MAXFLOAT)];
    _contentFrame = CGRectMake(CGRectGetMaxX(_headFrame) + 10.0f, CGRectGetMaxY(_nameFrame) + 10.0f, HARDWARE_SCREEN_WIDTH - 85.0f - CGRectGetMaxX(_headFrame) - 10.0f, contentSize.height);
    CGSize zanSize = [UIImage imageNamed:@"btn-good"].size;
    _zanFrame = CGRectMake(CGRectGetMaxX(_headFrame) + 10.0f, CGRectGetMaxY(_nameFrame) + 10.0f, HARDWARE_SCREEN_WIDTH - 85.0f - CGRectGetMaxX(_headFrame) - 10.0f, zanSize.height);
    if ([unReadComment.commentType isEqualToString:@"praise"]) {
        _timeFrame = CGRectMake(CGRectGetMaxX(_headFrame) + 10.0f, CGRectGetMaxY(_zanFrame) + 5.0f, HARDWARE_SCREEN_WIDTH - 85.0f - CGRectGetMaxX(_headFrame) - 10.0f, Font12.lineHeight);
    } else {
        _timeFrame = CGRectMake(CGRectGetMaxX(_headFrame) + 10.0f, CGRectGetMaxY(_contentFrame) + 5.0f, HARDWARE_SCREEN_WIDTH - 85.0f - CGRectGetMaxX(_headFrame) - 10.0f, Font12.lineHeight);
    }
    
    if (unReadComment.imageName.count > 0) {
        _picViewFrame = CGRectMake(HARDWARE_SCREEN_WIDTH - 75.0f, 10.0f, 60.0f, 60.0f);
    } else {
        _shareContentFrame = CGRectMake(HARDWARE_SCREEN_WIDTH - 75.0f, 10.0f, 65.0f, CGRectGetMaxY(_timeFrame) - 10.0f);

    }
    _lineFrame = CGRectMake(0, CGRectGetMaxY(_timeFrame) + 10.0f, HARDWARE_SCREEN_WIDTH, 0.5f);
    _cellHeight = CGRectGetMaxY(_lineFrame);
}

@end
